﻿#include "MultimediaProjectCollectionWindow.h"

MultimediaProjectCollectionWindow::MultimediaProjectCollectionWindow(QWidget* parent)
	: QWidget(parent)
{
	ui.setupUi(this);
	this->resize(QSize(320, 480));
	this->setWindowTitle("多媒体项目集合");
	this->setWindowIcon(QIcon("images/opencv.png"));
	createListView();
}

void MultimediaProjectCollectionWindow::createListView() {
	listView = new CommonListView(this);
	connect(listView, &CommonListView::itemClicked, [=](QListWidgetItem* item) {
		CommonListViewItem* item2 = dynamic_cast<CommonListViewItem*>(item);
		qDebug() << "itemPos:" << item2->mPos;
		switch (item2->mPos) {
		case 1://H265多路视频路放
			multiChannelMonitoringWindow = new MultiChannelMonitoringWindow();
			multiChannelMonitoringWindow->show();
			break;
		case 2://视频播放器
			xplay2 = new XPlay2();
			xplay2->show();
			break;
		case 3://屏幕录制工具
			screen = new XScreen();
			screen->show();
			break;
		case 4://视频转码工具
			transcodingWindow = new TranscodingWindow();
			transcodingWindow->show();
			break;
		case 5://像素格式转换工具
			pixelFormatConversionToolWindow = new PixelFormatConversionToolWindow();
			pixelFormatConversionToolWindow->show();
			break;
		case 6://OpenGL特效
			openGLSpecialEffectsWindow = new OpenGLSpecialEffectsWindow();
			openGLSpecialEffectsWindow->show();
			break;
		}
		});
	new CommonListViewItem("H265多路监控录放项目", QIcon("images/tezhengjiance.png"), QIcon("images/tezhengjiance.png"), 1, listView);
	new CommonListViewItem("视频播放器项目", QIcon("images/tezhengjiance.png"), QIcon("images/tezhengjiance.png"), 2, listView);
	new CommonListViewItem("屏幕录制项目", QIcon("images/tezhengjiance.png"), QIcon("images/tezhengjiance.png"), 3, listView);
	new CommonListViewItem("视频转码工具", QIcon("images/tezhengjiance.png"), QIcon("images/tezhengjiance.png"), 4, listView);
	new CommonListViewItem("像素格式转换工具", QIcon("images/tezhengjiance.png"), QIcon("images/tezhengjiance.png"), 5, listView);
	new CommonListViewItem("OpenGL特效项目", QIcon("images/tezhengjiance.png"), QIcon("images/tezhengjiance.png"), 6, listView);

}

MultimediaProjectCollectionWindow::~MultimediaProjectCollectionWindow()
{
}
